#pragma once
#include "IGameState.h"
#include "../SGD Wrappers/SGD_Handle.h"

/**************************************************************/
// LoadGameState class
//	- handles the main menu
//	- SINGLETON (statically allocated, not dynamic)
class LoadGameState : public IGameState
{
public:
	/**********************************************************/
	// Singleton Accessor
	static LoadGameState* GetInstance(void);


	/**********************************************************/
	// IGameState Interface:
	virtual void	Enter(void)				override;	// load resources
	virtual void	Exit(void)				override;	// unload resources

	virtual bool	Input(void)				override;	// handle user input
	virtual void	Update(float elapsedTime)	override;	// update entites
	virtual void	Render(void)				override;	// render entities / menu

	string GetFile(){ return loadPath; }
	string GetPlayerName(){ return playerName; }

protected:
	/**********************************************************/
	// SINGLETON!
	LoadGameState(void) = default;
	virtual ~LoadGameState(void) = default;

	LoadGameState(const LoadGameState&) = delete;
	LoadGameState& operator= (const LoadGameState&) = delete;


	/**********************************************************/
	// Cursor Index
	int		m_nCursor = 0;
	int		m_nNameCursor = 0;
	int		m_nNameCount = 0;
//	SGD::HTexture  m_hBackground = SGD::INVALID_HANDLE;
	SGD::HTexture  m_hKeyboard = SGD::INVALID_HANDLE;
	bool m_bDialogOpen = false;
	char m_cName[13];
	char keyboard[52];
	/**********************************************************/
	// Slots
	string slot1, slot2, slot3;
	string loadPath;

	string name1, name2, name3;

	bool choseSlot = false;
	string playerName = "Player";

	SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
	Game* theGame = Game::GetInstance();

	bool slot1Complete = false;
	bool slot2Complete = false;
	bool slot3Complete = false;
	bool deleting = false;
};